package com.Liuhang.Dao;

import com.Liuhang.entity.user;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class emp_update extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Integer id = Integer.parseInt(req.getParameter("id"));
        String name = (String) req.getParameter("name");
        String Passwd = (String) req.getParameter("passwd");
        String sex = (String) req.getParameter("sex");
        Integer phone = Integer.valueOf(req.getParameter("phone"));
        Integer money = Integer.valueOf(req.getParameter("money"));

        user u1 = new user(id,name,sex,phone,0,money,"",Passwd);
        req.setAttribute("u1",u1);
        System.out.println("这是update的信息="+u1);
        ServletContext context = this.getServletContext();
        context.getRequestDispatcher("/emp_update.jsp").forward(req,resp);
    }
}
